jArray.prototype.myReduce = function(callback, initValue) {
    const array = this
    // 记录结果
    let result = initValue === undefined ? array[0] : initValue
    let startIndex = initValue === undefined ? 1 : 0

    for(let i = startIndex; i <= array.length; i++) {
        result = callback(result, array[i], i, array)
    }
    // 返回
    return result
}